namespace CSharpPro._0929;
public class Demo3
{
    public static void Method3()
    {
        Console.WriteLine("1000 以内的水仙花数有：");
        for (int i = 100; i < 1000; i++)
        {
            int hundreds = i / 100; 
            int tens = (i / 10) % 10; 
            int units = i % 10; 
            if (Math.Pow(hundreds, 3) + Math.Pow(tens, 3) + Math.Pow(units, 3) == i)
            {
                Console.WriteLine(i);
            }
        }
    }
}